package com.business.bg.wyc.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.tools.ant.types.CommandlineJava.SysProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.business.bg.wyc.bean.Employee;
import com.business.bg.wyc.service.EmployeeService;

@Controller
public class IndexAction
{
    @Autowired
	private EmployeeService	employeeService;
	
    //aa
	
	@RequestMapping(value = "/index.do")
	public String index(HttpServletRequest request , HttpServletResponse response , Model model)
	{
		//Employee employee = employeeService.findById(1l);
		//employee.setName("wuyichao");
		//employeeService.save(employee);
		System.out.println(employeeService.findAll().get(0).getName());
		System.out.println(employeeService.getEmployeeDao().getSessionFactory().getStatistics().getSecondLevelCacheRegionNames());
		System.out.println(employeeService.getEmployeeDao().getSessionFactory().getStatistics().getSecondLevelCacheHitCount());
		return "/index.jsp";
	}
}
